package com.zhouz.admin.app.db.mybatis.Injector;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.zhouz.admin.app.db.mybatis.Injector.myInjector.DeleteRealInsert;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class MyLogicSqlInjector extends DefaultSqlInjector {
    public MyLogicSqlInjector(){
        super();
    }
    /**
     * 如果只需增加方法，保留MP自带方法
     * 可以super.getMethodList() 再add
     * @return
     */
    @Override
    public List<AbstractMethod> getMethodList() {
        List<AbstractMethod> methodList = super.getMethodList();
        // methodList.add(new UpdateAllowNullInsert());
        methodList.addAll(Stream.of(
                // new UpdateAllowNullInsert(),
                new DeleteRealInsert()
        ).collect(Collectors.toList()));
        return methodList;
    }
}